﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using WINADM.Data;
using System.Linq.Expressions;
using WINADM.Server;
using WINADM.Server.WMI;
using System.IO;
using System.Management;
using System.Timers;
namespace WINADMTester
{
    class Program
    {
        static Controller _controller = new Controller();
         
        static void Main(string[] args)
        {

            log4net.Config.XmlConfigurator.Configure();
            _controller.RegisterComputer();
            _controller.UpdateNetworkInterfaceInformation();
            _controller.UpdateProcessInformation();
            _controller.UpdateServiceInformation();
            //_controller.UpdateEventLogEntries();
            _controller.UpdateDriveInformation();
            _controller.UpdateComputerPerformanceStats();

            //Console.WriteLine(Environment.ProcessorCount);
            //Console.WriteLine(Environment.OSVersion.Platform + " | " + Environment.OSVersion.ServicePack + "  | " + Environment.OSVersion.Version + "  | " + Environment.OSVersion.VersionString);



            //tmr.Elapsed += new ElapsedEventHandler(tmr_Elapsed);
            //tmr.Start();

            //cnt.RegisterComputer();
            //cnt.UpdateNetworkInterfaceInformation();
            //cnt.UpdateProcessInformation();
            //cnt.UpdateEventLogEntries();
            //cnt.UpdateServiceInformation();
           // cnt.UpdateDriveInformation();
            //cnt.UpdateComputerPerformanceStats();
            //DriveInfo[] drives = DriveInfo.GetDrives();

            //Win32EventLogHelper de = new Win32EventLogHelper(null);
            //IList<Win32EventLog> lst = de.GetAllEventLogEntries(System.DateTime.Now.AddDays(-1));

            //_controller.RemoveComputer();
            //Win32ServiceHelper gg = new Win32ServiceHelper(null);

            ////Win32ProcessHelper ss = new Win32ProcessHelper(null);
            //IList<Win32DependentService> dd = gg.GetAllDependentService();

            //IList<Win32Service> ee = gg.GetAllServices();

            //ObjectQuery winQuery = new ObjectQuery("SELECT * FROM Win32_LogicalMemoryConfiguration");

            //ManagementObjectSearcher searcher = new ManagementObjectSearcher(winQuery);

            //foreach (ManagementObject item in searcher.Get())
            //{
            //    Console.WriteLine("Total Space = " + item["TotalPageFileSpace"]);
            //    Console.WriteLine("Total Physical Memory = " + item["TotalPhysicalMemory"]);
            //    Console.WriteLine("Total Virtual Memory = " + item["TotalVirtualMemory"]);
            //    Console.WriteLine("Available Virtual Memory = " + item["AvailableVirtualMemory"]);
            //}

            //Console.WriteLine("Total Commit Charge: " + GetCommitCharge());
    }

        
    }
}

